
from PIL import Image
from colorit import background, init_colorit
init_colorit();
d=int(input("w"));
#d0=int(input("h"));
imge=Image.open(input());
imge=imge.resize((d,d));
for y in range(imge.size[1]):
	for x in range(imge.size[0]):
		print(background(" ",imge.getpixel((x,y))),end='')
	print();
